package com.example.scala.chapter4

/**
 *
 * Description:
 *
 * Create by lucienoz on 2021/10/18.
 * Copyright © 2021 lucienoz. All rights reserved.
 */
object chapter05 {
	def main(args : Array[String]) : Unit = {
		def test()=(println("hello"))
		test()



		()=>{
			println("hhh")
		}



		def foo(bar:String):String={ //省略报错Error
			bar  //调用bar 而非返回函数对象
			return "test"
		}

		foo({
			println("asdads")
			"test"
		})

		new user().foo({
			println ( this )
			"user"
		})


	}

}
class user{
	def foo(bar:String):Unit={
		bar  //调用bar 而非返回函数对象
		println(this)
	}
}

